﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace QuanLyNhaSach
{
    public partial class Form_Main : DevComponents.DotNetBar.Office2007RibbonForm
    {
        Form_DangNhap frmdangnhap = null;
        Form_QLNhanVien frmqlnhanvien = null;

        Form_QLTacGia frmqltacgia = null;
        Form_QLTheLoai frmqltheloai = null;
        Form_QLNhaCungCap frmqlnhacungcap = null;
        Form_QLNhaXuatBan frmqlnhaxuatban = null;
        Form_QLBanHang frmqlbanhang = null;
        Form_PhieuNhap frmphieunhap = null;
        Form_PhieuXuat frmphieuxuat = null;
        Form_QLLoaiNhanVien frmqlloainhanvien = null;
        Form_QLSach frmqlsach = null;
        public Form_Main()
        {
            InitializeComponent();
            
        }

        private void buttonItemQLNhanVien_Click(object sender, EventArgs e)
        {
            if (frmqlnhanvien == null || frmqlnhanvien.IsDisposed)
            {
                frmqlnhanvien = new Form_QLNhanVien();
                frmqlnhanvien.MdiParent = Form_Main.ActiveForm;
                frmqlnhanvien.Show();
            }
            else
                frmqlnhanvien.Activate();
        }

        private void buttonItemQLTacGia_Click(object sender, EventArgs e)
        {
            if (frmqltacgia == null || frmqltacgia.IsDisposed)
            {
                frmqltacgia = new Form_QLTacGia();
                frmqltacgia.MdiParent = Form_Main.ActiveForm;
                frmqltacgia.Show();
            }
            else
                frmqltacgia.Activate();
        }

        private void buttonItemQLTheLoai_Click(object sender, EventArgs e)
        {
            if (frmqltheloai == null || frmqltheloai.IsDisposed)
            {
                frmqltheloai = new Form_QLTheLoai();
                frmqltheloai.MdiParent = Form_Main.ActiveForm;
                frmqltheloai.Show();
            }
            else
                frmqltheloai.Activate();
        }

        private void buttonItemQLNXB_Click(object sender, EventArgs e)
        {
            if (frmqlnhaxuatban == null || frmqlnhaxuatban.IsDisposed)
            {
                frmqlnhaxuatban = new Form_QLNhaXuatBan();
                frmqlnhaxuatban.MdiParent = Form_Main.ActiveForm;
                frmqlnhaxuatban.Show();
            }
            else
                frmqlnhacungcap.Activate();
        }

        private void buttonItemQLNCC_Click(object sender, EventArgs e)
        {
            if (frmqlnhacungcap == null || frmqlnhacungcap.IsDisposed)
            {
                frmqlnhacungcap = new Form_QLNhaCungCap();
                frmqlnhacungcap.MdiParent = Form_Main.ActiveForm;
                frmqlnhacungcap.Show();
            }
            else
                frmqlnhacungcap.Activate();
        }

        private void buttonItemHoaDon_Click(object sender, EventArgs e)
        {
            if (frmqlbanhang == null || frmqlbanhang.IsDisposed)
            {
                frmqlbanhang = new Form_QLBanHang();
                frmqlbanhang.MdiParent = Form_Main.ActiveForm;
                frmqlbanhang.Show();
            }
            else
                frmqlbanhang.Activate();
        }

        private void buttonItemPhieuNhap_Click(object sender, EventArgs e)
        {
            if (frmphieunhap == null || frmphieunhap.IsDisposed)
            {
                frmphieunhap = new Form_PhieuNhap();
                frmphieunhap.MdiParent = Form_Main.ActiveForm;
                frmphieunhap.Show();
            }
            else
                frmphieunhap.Activate();
        }

        private void buttonItemPhieuXuat_Click(object sender, EventArgs e)
        {
            if (frmphieuxuat == null || frmphieuxuat.IsDisposed)
            {
                frmphieuxuat = new Form_PhieuXuat();
                frmphieuxuat.MdiParent = Form_Main.ActiveForm;
                frmphieuxuat.Show();
            }
            else
                frmphieuxuat.Activate();
        }

        private void buttonItemQLLoaiNV_Click(object sender, EventArgs e)
        {
            if (frmqlloainhanvien == null || frmqlloainhanvien.IsDisposed)
            {
                frmqlloainhanvien = new Form_QLLoaiNhanVien();
                frmqlloainhanvien.MdiParent = Form_Main.ActiveForm;
                frmqlloainhanvien.Show();
            }
            else
                frmqlloainhanvien.Activate();
        }

        private void Form_Main_Load(object sender, EventArgs e)
        {
            //goi man hinh dang nhap
            
        }
        void DangNhap()
        {
            if (frmdangnhap == null || frmdangnhap.IsDisposed)
            {
                frmdangnhap = new Form_DangNhap();
                frmdangnhap.MdiParent = Form_Main.ActiveForm;
                frmdangnhap.Show();
            }
            else
                frmdangnhap.Activate();
        }

        private void buttonItemQLSach_Click(object sender, EventArgs e)
        {
            if (frmqlsach == null || frmqlsach.IsDisposed)
            {
                frmqlsach = new Form_QLSach();
                frmqlsach.MdiParent = Form_Main.ActiveForm;
                frmqlsach.Show();
            }
            else
                frmqlsach.Activate();
        }
    }
}
